package com.huzz.util.desin.prototype;

/**
 * @author huzz-
 */
public class Game {
    public static void main(String[] args) {
        // 创建原型怪物对象
        Monster originalMonster = new Monster("Goblin", 1);
        
        try {
            // 克隆怪物对象
            Monster clonedMonster = originalMonster.clone();
            
            // 修改克隆对象属性
            clonedMonster.setName("Orc");
            clonedMonster.setLevel(3);

            originalMonster.displayInfo();
            clonedMonster.displayInfo();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
    }
}
